package io.SerializableDemo;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class WriterObject {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("object.txt"));
        Person person = new Person("悟空",500);
        objectOutputStream.writeObject(person);
        objectOutputStream.close();
    }
}
